package com.ruoyi.common.exception;


import com.ruoyi.common.constant.ErrorCode;

/**
 * 重试错误异常
 *
 * @author admin
 */
public class ToRetryException extends RuntimeException {

    private static final long serialVersionUID = 3655050728585279326L;

    private int code = ErrorCode.ERROR.getCode();

    private String busId;

    public ToRetryException() {

    }

    public ToRetryException(String msg) {
        super(msg);
    }
    public ToRetryException(ErrorCode errorCode) {
        super(errorCode.getMessage());
        this.code = errorCode.getCode();
    }

    public ToRetryException(int code, String msg) {
        super(msg);
        this.code = code;
    }

    public ToRetryException(int code, String msg, Throwable cause) {
        super(msg, cause);
        this.code = code;
    }

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public String getBusId() {
        return busId;
    }

    public ToRetryException setBusId(String busId) {
        this.busId = busId;
        return this;
    }
}
